<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>http-stream</title>
</head>

<body>
  <span>server sent event</span>
  <button onclick="javascript:history.back()">back</button>

  <script type="text/javascript">
    var source = new EventSource('http://localhost:8088/evt');
    source.addEventListener('message', function (e) {
      console.log(e.data);
    }, false);
    source.onopen = function () {
      console.log('connected');
    }
    source.onerror = function (err) {
      console.log(err);
    }
  </script>
</body>

</html>
